<template>
  <div class="doubleEleven">
    <div class="back">
      <van-icon name="arrow-left" @click="$router.push('/home')" />
    </div>
    <div class="product-info">
      <div v-for="index in order" :key="index">
        <van-image
          class="product-img lazy-img product-img"
          :show-loading="false"
          lazy-load
          :src="
            'http://www.higuang365.com/public/images/common/activity/doubleEleven/' +
            index +
            '.jpg'
          "
        />
      </div>
      <router-link
        class="product-url"
        :style="{ top: 32 + index * 22.3 + 'rem' }"
        v-for="(value, index) in url"
        :key="index"
        :to="
          'http://www.higuang365.com/wap/#/product?id=' +
          value.id +
          '&parents_id='
        "
      >
      </router-link>
    </div>
  </div>
</template>
<script lang="ts">
import { wxapi } from "@/lib/ecapi";
import {
  defineComponent,
  reactive,
  toRefs,
  onActivated,
  onDeactivated,
} from "vue";

export default defineComponent({
  setup() {
    const data = reactive({
      order: 11,
      url: [
        { id: 2167 },
        { id: 2168 },
        { id: 2169 },
        { id: 2193 },
        { id: 2170 },
        { id: 2171 },
        { id: 2172 },
        { id: 2194 },
        { id: 2195 },
        { id: 2174 },
        { id: 2173 },
        { id: 2175 },
        { id: 2176 },
        { id: 2177 },
        { id: 2178 },
        { id: 2179 },
        { id: 2180 },
        { id: 2181 },
        { id: 2182 },
        { id: 2183 },
        { id: 2184 },
        { id: 2185 },
        { id: 2186 },
        { id: 2187 },
        { id: 2188 },
        { id: 2196 },
        { id: 2189 },
        { id: 2190 },
        { id: 2198 },
        { id: 2192 },
      ],
    });
    let scrollTop = 0;
    onActivated(() => {
        
    wxapi("嗨逛全球","嗨逛狂欢盛典，重磅来袭！海量超值礼包，快来抢购吧！","http://www.higuang365.com/wap/#/doubleEleven", "http://higuang365.com/public/app/site/statics/favicon.ico");
      let _dom = document.getElementById("app");
      if (_dom) {
        _dom.scrollTop = scrollTop;
      }
    });
    onDeactivated(() => {
      let _dom = document.getElementById("app");
      if (_dom) {
        scrollTop = _dom.scrollTop;
      }
    });
    return { ...toRefs(data) };
  },
});
</script>
<style lang="scss" scoped>
.doubleEleven {
  background: #de3a38;
  .product-img {
    display: block;
  }
  .back {
    position: fixed;
    font-size: 2rem;
    height: 5rem;
    line-height: 5rem;
    z-index: 100;
    color: #fff;
    width: 5rem;
  }
  .product-info {
    position: relative;
  }
  .product-url {
    position: absolute;
    left: 0;
    width: 100%;
    height: 22rem;
  }
}
</style>